'use strict';
// Copyright 2014 Blueant Inc. All Rights Reserved.

/**
 * @fileoverview 膜拜角色子项
 * @author sundbcn@gmail.com (sun debing)
 */

var mongoose = require('mongoose');
var _ = require('lodash');
var moment = require('moment');
var dataApi = require('../../libs/dataApi');

///////////////////////////////////////////////////////////
/**
 * 膜拜子项 
 * @type {mongoose}
 */
var worshiItemSchema = new mongoose.Schema({
    // 角色ID 
    role_id: {
        type: Number
    },

    // 创建时间
    create_time: {
        type: Date,
        default: moment()
    },
});

if (!worshiItemSchema.options.toJSON) {
    worshiItemSchema.options.toJSON = {};
}
/* jshint unused:false */
worshiItemSchema.options.toJSON.transform = function (doc, ret) {
    ret.create_time = moment(ret.create_time).unix();
    delete ret._id;
    delete ret.__v;
};

module.exports = worshiItemSchema;
